package util

import (
	"strconv"
	"time"
)

//获取日期字符窜
func GetNowTime(format string) string {

	var str string
	switch format {
	case "yyyy-MM-dd":
		str = time.Now().Format("2006-01-02")
		break
	case "yyyyMMdd":
		str = time.Now().Format("20060102")
		break
	case "yyyy-MM-dd hh-mm-ss":
		str = time.Now().Format("2006-01-02 15:04:05")
		break
	case "yyyy-MM":
		str = time.Now().Format("2006-01")
		break
	}
	return str
}

func GetNowYersWeek_str_name() string {
	t := time.Now()
	yers, week := t.ISOWeek()
	return strconv.Itoa(yers) + "第" + strconv.Itoa(week) + "周"
}
